Fix destroying k8s cluster on shared networks#4461
Conversation
|
@blueorangutan package |
|
@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2365 |
| NetworkVO kubernetesClusterNetwork = networkDao.findById(kubernetesCluster.getNetworkId()); | ||
| if (kubernetesClusterNetwork != null && kubernetesClusterNetwork.getGuestType() != Network.GuestType.Shared) { | ||
| deleteKubernetesClusterNetworkRules(); | ||
| } |
There was a problem hiding this comment.
I know I'm not a nice guy, but can we please have new code in separate methods:
private void checkForRulesToDelete(){
NetworkVO kubernetesClusterNetwork = networkDao.findById(kubernetesCluster.getNetworkId());
if (kubernetesClusterNetwork != null && kubernetesClusterNetwork.getGuestType() != Network.GuestType.Shared) {
deleteKubernetesClusterNetworkRules();
}
}
and then
| NetworkVO kubernetesClusterNetwork = networkDao.findById(kubernetesCluster.getNetworkId()); | |
| if (kubernetesClusterNetwork != null && kubernetesClusterNetwork.getGuestType() != Network.GuestType.Shared) { | |
| deleteKubernetesClusterNetworkRules(); | |
| } | |
| checkForRulesToDelete(); |
|
@blueorangutan package |
|
@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2369 |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2371 |
|
@blueorangutan test |
|
@Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3158)
|
|
@Pearl1594 is this really minor? k8 would not work at all in shared nets because of this would it? cc @PaulAngus |
|
@DaanHoogland It isn't a critical bug - and can be pushed to the next milestone if need be. It basically looks after the scenario wherein when a cluster deployed in a shared network doesn't get cleaned up / garbage collected and indefinitely stays in destroying state |
|
@Pearl1594 @DaanHoogland I think this should go to 4.14.1.0 |
|
@Pearl1594 can you rebase on 4.14? |
cf2e011 to
7b09f3c
Compare
|
Done @DaanHoogland |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2398 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3196)
|
|
Lgtm |
|
This fixes a valid case for a supported feature, let's merge |
Description
Deletion of K8s cluster on shared networks fails due to attempt to clear network rules, however, no network rules get added for clusters brought up on Shared networks.
Types of changes
How Has This Been Tested?
Deployed a cluster on a shared network and then cleaned it up